#ifndef NETWORKFAILEDRESPONSE_H
#define NETWORKFAILEDRESPONSE_H
#include "networkresponse.h"
#include <QNetworkReply>

namespace network {

class FailedResponse : public Response
{

    Q_OBJECT
public:
    enum DataError {
        NoError,
        JsonInvalided,
        PropertiesInvalided
    };

    FailedResponse(const FailedResponse::DataError &error,
                   const QString &message,
                   QObject *parent = 0);

    FailedResponse(const QNetworkReply::NetworkError &error,
                   const QString &message,
                   QObject *parent = 0);
public:
    Response::Type type() const;
    QVariant data() const;
private:

public:
    inline const QNetworkReply::NetworkError &networkError() const {
        return m_networkError;
    }

    inline const QString &networkMessage() const {
        return m_networkMessage;
    }

    inline const FailedResponse::DataError &dataError() const {
        return m_dataError;
    }

    inline const QString &dataMessage() const {
        return m_dataMessage;
    }

private:
    FailedResponse::DataError m_dataError;
    QString m_dataMessage;

    QNetworkReply::NetworkError m_networkError;
    QString m_networkMessage;

};
}
#endif // NETWORKFAILEDRESPONSE_H
